package com.example.gateway.apiapigateway.HttpInvoke;


import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.example.gateway.apiapigateway.entity.ApiInfo;

import java.util.HashMap;

public class HttpInvoker {

    /**
     *
     * Get 请求
     *
     * */
    public static HttpResponse InvokeByGet(ApiInfo apiInfo){
        return HttpRequest.get(apiInfo.getAUri()).execute();
    }

    /**
     *
     * Get带参请求
     *
     * */
    public static HttpResponse InvokeByGetWithParams(HashMap<String,String> parmasMap,ApiInfo apiInfo){
        String uriParmas = "";

        return HttpRequest.get(apiInfo.getAUri()+"/"+parmasMap.get("parma1")).execute();
    }

}
